package com.codeZ.ProxyPattern.staticProxy;

/**
 * 静态代理对象
 *
 * @author codeZhang
 * @Date 2024/8/8 10:06
 */
public class UserDaoProxy implements IUserDao{

    private final IUserDao target;

    public UserDaoProxy(IUserDao target) {
        this.target = target;
    }

    @Override
    public void save() {
        System.out.println("开启事务"); //扩展额外功能
        target.save();
        System.out.println("提交事务");
    }

}
